package com.yn.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum ZyOrderTypeEnum {

    NORMAL(1, "普通订单"),
    PUBLIC_WELFARE(2, "公益类型")

    ;

    private Integer code;

    private String name;

    public static ZyOrderTypeEnum getByCode(Integer code) {
        if(null == code) {
            return null;
        }
        for(ZyOrderTypeEnum orderTypeEnum : ZyOrderTypeEnum.values()) {
            if(orderTypeEnum.getCode() == code) {
                return orderTypeEnum;
            }
        }
        return null;
    }

}
